#include<bits/stdc++.h>
#define F(i,x,y) for(int i=(x);i<=(y);i++)
using namespace std;
int n,a[100010],b[100010];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    F(i,1,n)
    {
        scanf("%d",a+i);
        b[a[i]]++;
    }
    int p=0,s=0;
    F(i,1,100000)
    {
        int t=min(b[i],p);
        s+=t;
        p+=b[i]-t;
    }
    cout<<n-s;
    return 0;
}
//woyaodaqiu!!!
